package com.hdu.dwh.pojos.cube_pojos;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;

@Data
public class CubeMetric {
    @TableId(type = IdType.AUTO)
    private Integer id;

    @TableField("agg_function_name")
    private String aggFunctionName;
    private Integer cubeId;
    private String field;

    public CubeMetric(Integer _cubeId, String _aggFuncName, String _field) {
        this.cubeId = _cubeId;
        this.field = _field;
        this.aggFunctionName = _aggFuncName;
    }

    public String buildSQLString() {
        return aggFunctionName + "(" + getField() + ")";
    }
}
